package com.yoyoyo666.report.model.common;

public class SingletonResult<T> extends BaseResult {


    private T data;

    public static <T> SingletonResult<T> getSuccess(T data){
        SingletonResult<T> s = new SingletonResult();
        s.setData(data);
        s.setResult(true);
        s.setCode(0);
        return s;
    }

    public static <T> SingletonResult<T> getSingletonFail(){
        SingletonResult<T> s = new SingletonResult();
        s.setResult(false);
        s.setCode(1);
        return s;
    }
    public static <T> SingletonResult<T> getSingletonFail(String msg){
        SingletonResult<T> s = new SingletonResult();
        s.setResult(false);
        s.setCode(1);
        s.setMsg(msg);
        return s;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
}
